import requests
import json

def get_file_meta(filehash):
    url = "http://localhost:9090/file/meta"
    params = {
        "filehash": filehash
    }
    
    try:
        response = requests.get(url, params=params)
        response.raise_for_status()  # 检查请求是否成功
        data = response.json()  # 解析 JSON 响应
        print("File Meta:", data)
    except requests.exceptions.RequestException as e:
        print("Request failed:", e)
    except ValueError as e:
        print("Failed to parse JSON response:", e)

if __name__ == "__main__":
    filehash = "ad27508f2bdfe741dd68fe17801002025c75cae3"
    get_file_meta(filehash)